{include file='_header'}

<div class="page-header">当前位置：<span class="text-primary">退货地址管理</span></div>

<div class="page-content">
    <form action="" method="get" class="form-horizontal form-search" role="form">
        <div class="page-toolbar">
            <div class="col-md-4">
                <a class='btn btn-primary btn-sm' href="{:url('admin/shop/refundaddressadd')}"><i class='fa fa-plus'></i> 添加退货地址</a>
            </div>
            <div class="col-md-6 pull-right">
                <div class="input-group">
                    <input type="text" class="input-sm form-control" name='keyword' value="{$_GET['keyword']}" placeholder="请输入关键词" />
                    <span class="input-group-btn">
                        <button class="btn btn-primary" type="submit"> 搜索</button>
                    </span>
                </div>
            </div>
        </div>
    </form>

    {if empty(count($list))}
        <div class="panel panel-default">
            <div class="panel-body empty-data">未查询到相关数据</div>
        </div>
    {else}
        <form action="" method="post">
            <div class="page-table-header">
                <input type='checkbox' />
                <div class="btn-group">
                    <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除?" data-href="{:url('admin/shop/refundaddressdelete')}">
                        <i class='icow icow-shanchu1'></i> 删除</button>
                </div>
            </div>
            <table class="table table-hove table-responsive">
                <thead class="navbar-inner">
                    <tr>
                        <th style="width:25px;"></th>
                        <th>名称</th>
                        <th>联系人</th>
                        <th>手机</th>
                        <th>地址</th>
                        <th style='width:60px;'>默认</th>
                        <th style="width: 65px;">操作</th>
                    </tr>
                </thead>
                <tbody>
                    {foreach name='list' item='item'}
                        <tr>
                            <td>
                                <input type='checkbox' value="{$item['id']}"/>
                            </td>
                            <td>{$item['title']}</td>
                            <td>{$item['name']}</td>
                            <td>{$item['mobile']}</td>
                            <td>{$item['address']}</td>
                            <td>
                                <span class='label {if $item['isdefault']==1}label-primary{else}label-default{/if} defaults'
                                    data-toggle='ajaxSwitch'
                                    data-switch-value='{$item['isdefault']}'
                                    data-switch-value0='0|否|label label-default defaults|{:url('admin/shop/refundaddresssetdefault',array('isdefault'=>1,'id'=>$item['id']))}'
                                    data-switch-value1='1|是|label label-primary defaults|{:url('admin/shop/refundaddresssetdefault',array('isdefault'=>0,'id'=>$item['id']))}'
                                    data-switch-css='.defaults'
                                    data-switch-other = 'true'
                                >
                                {if $item['isdefault']==1}是{else}否{/if}</span>
                            </td>
                            <td style="text-align:left;">
                                <a href="{:url('admin/shop/refundaddressedit', array('id' => $item['id']))}" class="btn btn-op btn-operation">
                                    <span data-toggle="tooltip" data-placement="top" data-original-title="修改">
                                            <i class='icow icow-bianji2'></i>
                                        </span>
                                </a>
                                <a data-toggle='ajaxRemove' href="{:url('admin/shop/refundaddressdelete', array('id' => $item['id']))}"class="btn btn-op btn-operation" data-confirm='确认要删除此退货地址吗?'>
                                    <span data-toggle="tooltip" data-placement="top" data-original-title="删除">
                                           <i class='icow icow-shanchu1'></i>
                                        </span>
                                </a>
                            </td>
                        </tr>
                    {/foreach}
                </tbody>
                <tfoot>
                    <tr>
                        <td><input type="checkbox"></td>
                        <td colspan="2">
                            <div class="btn-group">
                                <button class="btn btn-default btn-sm btn-operation" type="button" data-toggle='batch-remove' data-confirm="确认要删除?" data-href="{:url('admin/shop/refundaddressdelete')}">
                                    <i class='icow icow-shanchu1'></i> 删除</button>
                            </div>
                        </td>
                        <td colspan="4" style="text-align: right">
                            {$pager}
                        </td>
                    </tr>
                </tfoot>
            </table>
        </form>
    {/if}

</div>
{include file='_footer'}